package com.bjpowernode.common;

public class ResultObject {

    //结果处理码 0：成功  其他：错误
    private int code;

    //是错误原因
    private String message;

    //向前端提供的数据
    private Object data;

    public ResultObject(){//无参构造

    }

    public ResultObject(int code, String message, Object data) {
        this.code = code;
        this.message = message;
        this.data = data;
    }

    public ResultObject(int code, String message) {
        this.code = code;
        this.message = message;
        this.data = "";
    }

    public static ResultObject buildError(){
        ResultObject ro =new ResultObject();
        ro.setCode(10000);//默认错误码
        ro.setMessage("");
        ro.setData("");
        return ro;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }
}
